import random
import unittest

try:
    import uncrobotics
except:
    print "Please put the uncrobotics module in the python path before testing"
    exit()

class TestFooBarClass(unittest.TestCase):

    def setUp(self):
        self.f = uncrobotics.FooBar()

    def testInitialValue(self):
        self.assert_(self.f.getFoo() == "Foo!")

    def testSettingFooValue(self):
        self.f.setFoo("Bar")
        self.assert_(self.f.getFoo() == "Bar")

    def testSquare(self):
        for i in range(1000):
            self.assert_(self.f.square(i) == i*i)

def main():
	unittest.main()

if __name__ == '__main__':
	main()

